<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<div class="modal-dialog x-modal-dialog" style="width: 600px; margin-top: 150px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb no-bottom-border clearfix">

      <h2>
        <i class="glyphicon glyphicon-fire" title="改变状态"></i>&nbsp;&nbsp;${courseRound.courseStatus.hold ? '解冻' : '冻结'}
      </h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/year-rounds/${courseRound.id}/toggle-freeze" data-validate="true">

      <input type="hidden" name="_method" value="PATCH">

      <div class="modal-body">
        <c:choose>
          <c:when test="${not courseRound.courseStatus.hold}">
            <c:choose>
              <c:when test="${not empty courseRound.courseUnit}">
                <c:choose>
                  <c:when test="${courseRound.courseUnit == 'YEAR_ROUND' || courseRound.courseUnit == 'YEAR_SPECIAL_ROUND'}">
                    <div class="form-group x-form-group">
                      <label class="col-xs-3 control-label">冻结期限</label>
                      <div class="pull-left col-xs-7">
                        <p class="form-control-static">60天</p>
                        <input type="hidden" name="holdMonth" value="60">
                      </div>
                    </div>
                  </c:when>
                  <c:when test="${courseRound.courseUnit == 'SEASON_ROUND' || courseRound.courseUnit == 'SEASON_SPECIAL_ROUND'}">
                    <div class="form-group x-form-group">
                      <label class="col-xs-3 control-label">冻结期限</label>
                      <div class="pull-left col-xs-7">
                        <p class="form-control-static">14天</p>
                        <input type="hidden" name="holdMonth" value="14">
                      </div>
                    </div>
                  </c:when>
                  <c:when test="${courseRound.courseUnit == 'MONTH_ROUND' || courseRound.courseUnit == 'MONTH_SPECIAL_ROUND'}">
                    <div class="form-group x-form-group">
                      <label class="col-xs-3 control-label">冻结期限</label>
                      <div class="pull-left col-xs-7">
                        <p class="form-control-static">月卡无法冻结</p>
                        <input type="hidden" name="holdMonth" value="14">
                      </div>
                    </div>
                  </c:when>
                </c:choose>
              </c:when>
              <c:otherwise>
                <div class="form-group x-form-group">
                  <label class="col-xs-3 control-label">冻结期限</label>
                  <div class="pull-left col-xs-7">
                    <p class="form-control-static">60天</p>
                    <input type="hidden" name="holdMonth" value="60">
                  </div>
                </div>
              </c:otherwise>
            </c:choose>
          </c:when>
          <c:otherwise>
            <div class="modal-body">
              <p class="confirm">
                <i class="glyphicon glyphicon-flash glyphicon-position-fix-2"></i>&nbsp;&nbsp;是否确认解冻?
              </p>
            </div>
          </c:otherwise>
        </c:choose>

      </div>

      <div class="modal-footer clearfix">
        <c:choose>
          <c:when test="${not empty courseRound.courseUnit}">
            <c:choose>
              <c:when test="${courseRound.courseUnit != 'MONTH_ROUND' && courseRound.courseUnit != 'MONTH_SPECIAL_ROUND'}">
                <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
              </c:when>
            </c:choose>
          </c:when>
          <c:otherwise>
            <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
          </c:otherwise>
        </c:choose>
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>
    </form>

  </div>

</div>

